home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D Speech Pack / 4D Speech Pack.rsrc / TEXT_27322_†SP Voice Pause.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  1.9 KB  |  57 lines

  1. SP Voice Pause (reference) -> err
  2.  
  3. reference   integer       specifys the channel you want to pause. Use the
  4.                                     reference number obtained from the
  5.                                    SP Open Voice function.
  6. err             integer       returns the error which occured. 
  7.                                     A value of zero indicates no error occured. See 
  8.                                     below for a list of possible errors.
  9.  
  10. Function to pause the specified speech channel speaking the lines.
  11.  
  12. The SP Voice Pause, SP Voice Cont and SP Voice Stop functions are perfectly suited to make a row of buttons to play, stop, pause and continue the speech of the selected text in a text field.
  13.  
  14. When you pass reference value -1 all currently opened speech channels will be paused.
  15.  
  16. Example:
  17.   `pause the voice until continue command
  18.   $err:=SP Voice Pause ($speechref)
  19.   `let the voice continue
  20.   $err:=SP Voice Cont ($speechref)
  21.   `stop speaking
  22.   $err:= SP Voice Stop ($speechref)
  23.  
  24.   `the example below tries to open all installed voices and let them start
  25.   `speaking at the same time
  26.   For ($i;1;$count)
  27.     `get the voicename based on the index number
  28.     $err:=SP Voicename ($i;$voicename)
  29.   `open a speech channel for the voice
  30.   $err:=SP Open Voice ($voicename;$speechref)
  31.     
  32.   If ($err=0)
  33.     `pass text and pause before start speaking
  34.     $err:=SP Voice Text ($speechref;$lines;1;1;4)
  35.    End if 
  36.  
  37.   End for 
  38.  
  39.   $err:=SP Voice Cont (-1) `now continue all voices
  40.   `at this point all voices will start speaking (gibberish) which will take
  41.   `a lot of CPU time!
  42.   While (SP Speaking >0)
  43.   `while anyone is speaking wait for it to finish
  44.    IDLE
  45.   End while 
  46.  
  47.   $err:=SP Close Voice (-1) `close all channels
  48.  
  49. Possible errors:
  50.         0  No Error
  51.       -4  Speech Pack can not be used (Speech Mgr not available)
  52. -3000  Invalid SpeechChannel parameter, probably invalid reference
  53.             number
  54.  
  55.  
  56.  
  57.